package com.chenjun.core.dao.generator.mapper;

import com.chenjun.common.model.DataGridModel;
import com.chenjun.core.dao.generator.entity.OaDictHolidays;
import com.chenjun.core.dao.generator.entity.OaDictSeasonCfg;
import com.chenjun.core.dao.generator.entity.OaDictSeasonCfgExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface OaDictSeasonCfgMapper {
    @Delete({
        "delete from oa_dict_season_cfg",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into oa_dict_season_cfg (id, code, ",
        "name, status, create_time, ",
        "update_time, operator, ",
        "note, on_duty_time, ",
        "off_duty_time, latest_on_duty_time, ",
        "earliest_off_duty_time)",
        "values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, ",
        "#{name,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{operator,jdbcType=INTEGER}, ",
        "#{note,jdbcType=VARCHAR}, #{onDutyTime,jdbcType=TIMESTAMP}, ",
        "#{offDutyTime,jdbcType=TIMESTAMP}, #{latestOnDutyTime,jdbcType=TIMESTAMP}, ",
        "#{earliestOffDutyTime,jdbcType=TIMESTAMP})"
    })
    int insert(OaDictSeasonCfg record);

    int insertSelective(OaDictSeasonCfg record);

    List<OaDictSeasonCfg> selectByExample(OaDictSeasonCfgExample example);

    @Select({
        "select",
        "id, code, name, status, create_time, update_time, operator, note, on_duty_time, ",
        "off_duty_time, latest_on_duty_time, earliest_off_duty_time",
        "from oa_dict_season_cfg",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    OaDictSeasonCfg selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(OaDictSeasonCfg record);

    @Update({
        "update oa_dict_season_cfg",
        "set code = #{code,jdbcType=VARCHAR},",
          "name = #{name,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "operator = #{operator,jdbcType=INTEGER},",
          "note = #{note,jdbcType=VARCHAR},",
          "on_duty_time = #{onDutyTime,jdbcType=TIMESTAMP},",
          "off_duty_time = #{offDutyTime,jdbcType=TIMESTAMP},",
          "latest_on_duty_time = #{latestOnDutyTime,jdbcType=TIMESTAMP},",
          "earliest_off_duty_time = #{earliestOffDutyTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(OaDictSeasonCfg record);
    
    List<OaDictSeasonCfg> selectByCondition(DataGridModel param);
}